package com.bnp.reporting.java8.lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * Created by Adib on 11/16/2014.
 */
public class SortLambda {
    public static void main(String[] args) {
        String[] testStrings = {"BNP-Paribas", "Montreal", "Canada"};

        Arrays.sort(testStrings, (s1, s2) -> s1.length() - s2.length());
/*
        Arrays.sort(testStrings, new Comparator<String>() {
            @Override
            public int compare(String s1, String s2) {
                return s1.length() - s2.length();
            }
        });
*/

        System.out.println(Arrays.toString(testStrings));

    }
}
